package model.event;

/**
 * This class represents a StatisticsEvent. A StatisticsEvent is for example the
 * maximum bid price of a user or the average auction time.
 * 
 * @version 1.0 vom 12.11.2012
 * @author Distributed Group 111 1026312, 1026309
 */

public class StatisticsEvent extends Event {

	private static final long serialVersionUID = 5192656551411712305L;
	private double value;

	public StatisticsEvent(EventType type, double value) {
		super(type);
		this.value = value;
	}

	public double getPrice() {
		return this.value;
	}

	public String toString() {
		super.toString();
		if (EventType.USER_SESSIONTIME_MIN.equals(this.type))
			return super.toString() + "minimum session time is " + this.value
					+ " seconds";
		else if (EventType.USER_SESSIONTIME_MAX.equals(this.type))
			return super.toString() + "maximum session time is " + this.value
					+ " seconds";
		else if (EventType.USER_SESSIONTIME_AVG.equals(this.type))
			return super.toString() + "average session time is " + this.value
					+ " seconds";
		else if (EventType.BID_PRICE_MAX.equals(this.type))
			return super.toString() + "maximum bid price seen so far is "
					+ this.value;
		else if (EventType.BID_COUNT_PER_MINUTE.equals(this.type))
			return super.toString() + "current bids per minute is "
					+ this.value;
		else if (EventType.AUCTION_TIME_AVG.equals(this.type))
			return super.toString() + "average auction time is " + this.value;
		else if (EventType.AUCTION_SUCCESS_RATIO.equals(this.type))
			return super.toString() + "auction success ratio is " + this.value;
		else
			return "";
	}
}